/*
 *  DefineUtil.h
 *  iphone_recharge
 *
 *  Created by xuyue on 12-8-17.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */

//#include "HPUIEngine.h"


#define ScreenWidth     [UIScreen mainScreen].bounds.size.width
#define ScreenHeight    [UIScreen mainScreen].bounds.size.height

// 键盘大小
#define kKeyboardSize   CGSizeMake(320, 236)

#define IOS7_VIEW_FRAME_Y 64
#define HEIGHT_NAVIGATION_BAR  44
#define HEIGHT_STATUS_BAR      20
#define TABBAR_HEIGHT         49

#define iOS7Later   ([[[UIDevice currentDevice] systemVersion]doubleValue]>=7.0)

#define HEIGHT_VIEW_HEADER   (iOS7Later ? IOS7_VIEW_FRAME_Y : HEIGHT_NAVIGATION_BAR)

#define Iphone7ViewRectDown if(([[[UIDevice currentDevice] systemVersion]doubleValue]>=7.0)){self.edgesForExtendedLayout = UIRectEdgeNone;}


#pragma mark - Colors

#define RGBCOLOR(r,g,b) \
    [UIColor colorWithRed:r/256.f green:g/256.f blue:b/256.f alpha:1.f]

#define RGBACOLOR(r,g,b,a) \
    [UIColor colorWithRed:r/256.f green:g/256.f blue:b/256.f alpha:a]

#define UIColorFromRGB(rgbValue) \
    [UIColor \
        colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
               green:((float)((rgbValue & 0x00FF00) >> 8))/255.0 \
                blue:((float)(rgbValue & 0x0000FF))/255.0 \
               alpha:1.0]

#define UIColorFromRGBA(rgbValue, alphaValue) \
    [UIColor \
        colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
               green:((float)((rgbValue & 0x00FF00) >> 8))/255.0 \
                blue:((float)(rgbValue & 0x0000FF))/255.0 \
               alpha:alphaValue]



#define KEY_RESPHEARDERS                        @"RespHeaders"
#define KEY_RESPCODE                            @"respCode"
#define KEY_RESPERRORMSG                        @"respErrMsg"
#define KEY_RESPDATA                            @"respData"

#define KEY_SCR_VIEWS                           @"views"
#define KEY_SCR_ID                              @"screenId"
#define KEY_SCR_PARAMS                          @"screenParams"
#define KEY_SCR_INDEX                           @"screenIndex"

#define KEY_HIDE_BAR_YES                        @"YES"
#define KEY_HIDE_BAR_NO                         @"NO"

#define KEY_CALLBACK                            @"callback"

#define KEY_SCREEN_NAME                         @"screenName"

// 淡蓝色 -- title颜色
#define kBkgColor               UIColorFromRGB(0x0a1b74)

// 亮灰色 -- 小部分字体颜色
#define kLightGrayColor         UIColorFromRGB(0xa8a8a8)

// 灰色 
#define kGrayColor              UIColorFromRGB(0xd2d2d2)

// 橘黄色
#define kOrangeColor            UIColorFromRGB(0xff9204)

// 天蓝色
#define kSkyColor               UIColorFromRGB(0x12a6e4)

// 淡蓝色 -- 边框颜色
#define kLightBlueColor         UIColorFromRGB(0xcfe2e9)

//淡绿色
#define kGreenColor             UIColorFromRGB(0x4d9ac4)

